package com.ruoyi.uni.mapper;

import java.util.List;

import com.ruoyi.uni.domain.DcTypes;
import org.apache.ibatis.annotations.*;

/**
 * 点餐类型Mapper接口
 * 
 * @author hx
 * @date 2024-04-14
 */

public interface DcTypesMapper 
{

    @Update("update  dc_types set location=#{location} where id=#{id}")
    public Long updateLocationById(@Param("id") Long id,@Param("location") Long location);
    @Result(column = "type_name", property = "typeName")
    @Select("select * from dc_types where location<#{location} order by location desc limit 1")
    public DcTypes selectMoveUp(Long location);
    @Result(column = "type_name", property = "typeName")
    @Select("select * from dc_types where location>#{location} order by location  limit 1")
    public DcTypes selectMoveDown(Long location);
    @Result(column = "type_name", property = "typeName")
    @Select("select * from dc_types  order by location  limit 1")
    public DcTypes selectMoveTop();
    @Select("SELECT COUNT(*) FROM dc_types")
    public Long selectDcTypesCount();
    /**
     * 查询点餐类型
     * 
     * @param id 点餐类型主键
     * @return 点餐类型
     */
    public DcTypes selectDcTypesById(Long id);

    /**
     * 查询点餐类型列表
     * 
     * @param dcTypes 点餐类型
     * @return 点餐类型集合
     */
    public List<DcTypes> selectDcTypesList(DcTypes dcTypes);

    /**
     * 新增点餐类型
     * 
     * @param dcTypes 点餐类型
     * @return 结果
     */
    public int insertDcTypes(DcTypes dcTypes);

    /**
     * 修改点餐类型
     * 
     * @param dcTypes 点餐类型
     * @return 结果
     */
    public int updateDcTypes(DcTypes dcTypes);

    /**
     * 删除点餐类型
     * 
     * @param id 点餐类型主键
     * @return 结果
     */
    public int deleteDcTypesById(Long id);

    /**
     * 批量删除点餐类型
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDcTypesByIds(Long[] ids);
}
